package com.weitu.environmental.monitor.service.impl;

import com.weitu.environmental.monitor.entity.MonitoringPersonnel;
import com.weitu.environmental.monitor.mapper.MonitoringPersonnelMapper;
import com.weitu.environmental.monitor.service.MonitoringPersonnelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author zhangqingxi 2017-05-09
 */
@Service
public class MonitoringPersonnelServiceImpl implements MonitoringPersonnelService {

    private final MonitoringPersonnelMapper monitoringPersonnelMapper;

    @Autowired
    public MonitoringPersonnelServiceImpl(MonitoringPersonnelMapper monitoringPersonnelMapper) {
        this.monitoringPersonnelMapper = monitoringPersonnelMapper;
    }

    @Override
    public List<MonitoringPersonnel> findByParam(Map paramMap) {
        return monitoringPersonnelMapper.findByParam(paramMap);
    }


    @Override
    public Integer findByParamCount(Map paramMap) {
        return monitoringPersonnelMapper.findByParamCount(paramMap);
    }

    @Override
    public MonitoringPersonnel findById(String id) {
        return monitoringPersonnelMapper.findById(id);
    }

    @Transactional
    @Override
    public Integer add(Map paramMap) {

        return monitoringPersonnelMapper.add(paramMap);
    }

    @Transactional
    @Override
    public Integer updateById(Map paramMap) {

        return monitoringPersonnelMapper.updateById(paramMap);
    }


}
